package com.gismore.demo.web;

import com.gismore.demo.common.service.LocaleMessageSourceService;
import com.gismore.demo.db.domain.SecUser;
import com.gismore.demo.db.mapper.SecUserMapper;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by lei on 2017/5/25.
 */
@RestController
public class HelloController {
	@Autowired
	private SecUserMapper secUserMapper;
	@Autowired
	private LocaleMessageSourceService localeMessageSourceService;

	@RequestMapping("/")
	public List<SecUser> findList(){
		throw new IndexOutOfBoundsException();
		//return secUserMapper.selectList(new EntityWrapper<SecUser>());
	}
	@RequiresRoles("admin")
	@RequestMapping("/all1")
	public List<SecUser> findAll(){
		return secUserMapper.findAll();
	}
}
